package ListDemo.List.TrssSetDemo;

import java.util.TreeSet;

public class TreeSetDemo2 {
    public static void main(String[] args) {
        TreeSet<Student> st = new TreeSet<>();
        Student s1 = new Student("张三", "男", 11);
        Student s2 = new Student("李四", "男", 12);
        Student s3 = new Student("王五", "男", 13);


        //将学生添加到集合中
        st.add(s1);
        st.add(s2);
        st.add(s3);
        System.out.println(st);
    }

}
